import _axios from '@/utils/request'

// import store from '@/store'

export default class Index {
  /**
	 * 根据班级ID，获取所有学生（检测首页，选择班级）
	 * @method get
	 */
  static async GetUserByClassId(params) {
    const groups = await _axios({
      method: 'get',
      url: '/api/Class/GetUserByClassId',
      params,
      handleError: true
    })
    return groups
  }
  /*Monitoring*/
  /**
   * 根据登录账号获取班级和课程下拉框(登录成功后加载)
   * @method get
   */
  static async GetMonitoringSelect(data) {
    const groups = await _axios({
      method: 'get',
      url: '/api/Monitoring/Index',
      data,
      handleError: true
    })
    return groups
  }
  /**
   * 点击开始检测
   * @method post
   */
  static async StartMonitoring(data) {
    const groups = await _axios({
      method: 'post',
      url: '/api/Monitoring/StartMonitoring',
      data,
      handleError: true
    })
    return groups
  }
  /**
   * 点击开始检测
   * @method get
   */
  static async GetClass(params) {
    const groups = await _axios({
      method: 'get',
      url: '/api/Monitoring/GetClass',
      params,
      handleError: true
    })
    return groups
  }
  /*Tasker*/
  /**
   * 检测首页-》心率页面【每分钟获取学生个人达标和加油(每分钟刷新一次)】
   * @method get
   */
  static async GetStudent_StandardAndStrive_PerMinute(params) {
    const groups = await _axios({
      method: 'get',
      url: '/api/Tasker/GetStudent_StandardAndStrive_PerMinute',
      params,
      handleError: true
    })
    return groups
  }
  /**
   * 首页-强度页面（6秒刷新一次）
   * @method get
   */
  static async GetStudent_HeartRate_Intensity(params) {
    const groups = await _axios({
      method: 'get',
      url: '/api/Tasker/GetStudent_HeartRate_Intensity',
      params,
      handleError: true
    })
    return groups
  }
  /**
   * 首页-密度页面（6秒刷新一次）
   * @method get
   */
  static async GetStuden_heartRate_Density(params) {
    const groups = await _axios({
      method: 'get',
      url: '/api/Tasker/GetStuden_heartRate_Density',
      params,
      handleError: true
    })
    return groups
  }
  /**
   * 班级拟合心率图(刷新时间待定)
   * @method get
   */
  static async ClassHeartRateChart(params) {
    const groups = await _axios({
      method: 'get',
      url: '/api/Tasker/ClassHeartRateChart',
      params,
      handleError: true
    })
    return groups
  }
  /**
   * 班级实时页面结构分布（每分钟刷新一次）
   * @method get
   */
  static async CalssStructuralDistribution(params) {
    const groups = await _axios({
      method: 'get',
      url: '/api/Tasker/CalssStructuralDistribution',
      params,
      handleError: true
    })
    return groups
  }
  /**
   * 点击关闭实时
   * @method get
   */
  static async CloseMonitoring(data) {
    const groups = await _axios({
      method: 'post',
      url: '/api/Monitoring/CloseMonitoring',
      data,
      handleError: true
    })
    return groups
  }

  /**
   * 备组管理首页【Get】（
   * @method get
   */
  static async Device(params) {
    const groups = await _axios({
      method: 'get',
      url: '/api/Device/Index',
      params,
      handleError: true
    })
    return groups
  }
  /**
   * 日常模式-数据监测（五分钟刷新一次）
   * @method get
   */
  static async DailyMode(params) {
    const groups = await _axios({
      method: 'get',
      url: '/api/Tasker/DailyMode',
      params,
      handleError: true
    })
    return groups
  }
  /**
   * 批量绑定-获取班级和设备组
   * @method get
   */
  static async GetBatchBind(params) {
    const groups = await _axios({
      method: 'get',
      url: '/api/Device/GetBatchBind',
      params,
      handleError: true
    })
    return groups
  }
  /**
   * 批量绑定设备组
   * @method get
   */
  static async BatchBing(params) {
    const groups = await _axios({
      method: 'post',
      url: '/api/Device/BatchBing',
      params,
      handleError: true
    })
    return groups
  }
  /**
   * 单人绑定设备
   * @method post
   */
  static async PersonalBind(params) {
    const groups = await _axios({
      method: 'post',
      url: '/api/Device/PersonalBind',
      params,
      handleError: true
    })
    return groups
  }

}
